{extend name="base/layer_layout" /}


{block name="body"}
<article class="cl pd-20">
    <form action="{:url('admin/AuthManager/save')}" method="post" class="form form-horizontal" id="form-admin-edit">
        <input type="hidden" name="id" value="{$info.id|default=0}">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>管理组名：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="" id="title" name="title" value="{$info.title|default=''}">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea name="description" cols="" rows="" class="textarea"  placeholder="来点描述吧..." dragonfly="true" onKeyUp="textarealength(this,100)">{$info.description|default=''}</textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
{/block}

{block name="script"}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__EXP_PLUGIN__/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__EXP_PLUGIN__/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__EXP_PLUGIN__/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form-admin-edit").validate({
            rules:{
                title:{
                    required:true
                }
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit(function (result) {
                    layer.msg(result.msg);
                    if (result.code == 1) {
                        setTimeout(function () {
                            window.parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.$('.btn-refresh').click();
                            parent.layer.close(index);
                        }, 1500);
                    }
                });
            }
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
{/block}